﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DatabaseUserTest.DB
{
    public class DBPlaneInterior
    {
        static DatabaseUserTest.DatabaseContext db = new DatabaseUserTest.DatabaseContext();

        public PlaneInterior FindPlaneInterior(int interiorId)
        {
            return db.PlaneInteriors.Find(interiorId);
        }
        public List<PlaneInterior> FindAllPlaneInterior()
        {
            
            List<PlaneInterior> planeList = new List<PlaneInterior>();
            var query = from d in db.PlaneInteriors select d;

            foreach (PlaneInterior item in query)
            {
                planeList.Add(item);
            }
            return planeList;
            
        }
        public void AddInterior(PlaneInterior interior)
        {
            db.PlaneInteriors.Add(interior);
            db.SaveChanges();
        }

    }
}
